/*
 * @Author: 阿伟呦 10486982+ah-weiyou@user.noreply.gitee.com
 * @Date: 2022-05-30 15:05:51
 * @LastEditors: 阿伟呦 10486982+ah-weiyou@user.noreply.gitee.com
 * @LastEditTime: 2022-05-31 15:14:31
 * @FilePath: \clb\advancejs-2107-a\react-webpack-project\scripts\webpack.dev.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const {merge} = require('webpack-merge')
const baseConfig = require('./webpack.base')
module.exports = merge(baseConfig, {
  mode: 'development',
  devtool: 'inline-source-map',
  devServer: {
    // contentBase: './dist',
    hot: true,
    port: 4001,
    historyApiFallback: true, // history 路由
    proxy: {
      '/api': {
        target: 'http://localhost:8080', 
        pathRewrite: {'^/api' : ''},
        secure: false,
        changeOrigin: true
      }
    }
  },
})
